 <?php
                    
                // create dialog
                $this->beginWidget('zii.widgets.jui.CJuiDialog', array(
                    'id'=>'createDialog',
                    // additional javascript options for the dialog plugin
                    'options'=>array(
                        'title'=>'Create New',
                        'autoOpen'=>false,
                        'modal' => true,
                        'width' => '500'
                    ),
                ));
                
                $this->beginWidget('ext.widgets.XPanel', array('title' => 'Pemakaian Meetingroom', 'width' => 900,'height' => 500)); 
                ?>
                <div class="form">

                <?php $form=$this->beginWidget('ext.CAxActiveForm', array(
                        'id'=>'pemakaian-meetingroom-form',
                        'enableAjaxValidation'=>false,
                        'enableClientValidation'=>true,
                        'action' => Yii::app()->createUrl('Meetingroom/createPemakaian')
                )); ?>

                        <p class="note">Fields with <span class="required">*</span> are required.</p>

                        <?php echo $form->errorSummary($PemakaianMeetingroom); ?>
                    <table class="ma-table">
                        <tbody>
                        <tr>    
                                <td class="labelfield" style="width:200px"><?php echo $form->labelEx($PemakaianMeetingroom,'mulai'); ?>
                </td>
                                <td>
                                    <?php
                                    $this->widget(
                                                'ext.jui.EJuiDateTimePicker',
                                                array(
                                                    'model'     => $PemakaianMeetingroom,
                                                    'attribute' => 'mulai',
                                                    'language'=> 'en',//default Yii::app()->language
                                                    'mode'    => 'datetime',//'datetime' or 'time' ('datetime' default)
                                                    'options'   => array(
                                                        'dateFormat' => 'dd-mm-yy',
                                                        'timeFormat' => 'hh:mm tt',//'hh:mm tt' default
                                                    ),
                                                    'htmlOptions'=>array(
                                                        'placeholder'=>'Tanggal'
                                                    )
                                                )
                                            );
                                    ?>
                                </td>
                                <td><?php echo $form->error($PemakaianMeetingroom,'mulai'); ?>
                </td>
                        </tr>

                        <tr>
                                <td class="labelfield" style="width:200px"><?php echo $form->labelEx($PemakaianMeetingroom,'akhir'); ?>
                </td>
                                <td>
                                    <?php
                                    $this->widget(
                                                'ext.jui.EJuiDateTimePicker',
                                                array(
                                                    'model'     => $PemakaianMeetingroom,
                                                    'attribute' => 'akhir',
                                                    'language'=> 'en',//default Yii::app()->language
                                                    'mode'    => 'datetime',//'datetime' or 'time' ('datetime' default)
                                                    'options'   => array(
                                                        'dateFormat' => 'dd-mm-yy',
                                                        'timeFormat' => 'hh:mm tt',//'hh:mm tt' default
                                                    ),
                                                    'htmlOptions'=>array(
                                                        'placeholder'=>'Tanggal'
                                                    )
                                                )
                                            );
                                     ?>
                                </td>
                                <td><?php echo $form->error($PemakaianMeetingroom,'akhir'); ?>
                </td>
                        </tr>

                        <tr>
                                <td class="labelfield" style="width:200px"><?php echo $form->labelEx($PemakaianMeetingroom,'keterangan'); ?>
                </td>
                                <td><?php echo CHtml::activeTextField($PemakaianMeetingroom,'keterangan'); ?>
                </td>
                                <td><?php echo $form->error($PemakaianMeetingroom,'keterangan'); ?>
                </td>
                        </tr>

                        <tr>
                                <td></td>
                                <td><?php echo CHtml::ajaxSubmitButton(
                                        'Create',
                                        CHtml::normalizeUrl(
                                                array(
                                                    'Meetingroom/createPemakaian',
                                                    'render'=>false
                                                    )),
                                        array(
                                            'success'=>'js: function(data) {
                                            $("#createDialog").dialog("close");
                                            location.reload();
                                        }'),
                                        array(
                                            'id'=>'closeJobDialog',
                                            'class' =>'ax-button'
                                            )
                                       );  ?>
                </td>
                                <td></td>
                        </tr>
                        </tbody>
                    </table>
                <?php 
                
                echo CHtml::hiddenField(
                        'id_meetingroom',
                        $model->id_meetingroom
                        ); 
                echo CHtml::hiddenField(
                        'id_pegawai',
                        Yii::app()->user->id
                        ); 
                $this->endWidget(); 
                
                ?>

                </div><!-- form -->
                <?php 
                $this->endWidget(); 

                
                $this->endWidget('zii.widgets.jui.CJuiDialog'); //CJuiDialog

            // the link that may open the dialog
                    echo " ".CHtml::button('Create New', array(
                        'class' => 'ax-btn',
                    'onclick'=>'$("#createDialog").dialog("open"); return false;',
                    ));

                ?>